
  //清除设置
  function clearCell() {
    WeekreportForm.reset();
  }

  //保存设置
  function save() {
    if(checjkTime(WeekreportForm.noteTime.value)){
	  var count=0;
	  var nodeCodeRow = document.getElementsByName("nodeCodeRow");
	  var nodeNameRow=document.getElementsByName("nodeNameRow");
	  var globalformIDRow = document.getElementsByName("globalformID");
	  for(i=0;i<nodeCodeRow.length;i++){
	    if (nodeCodeRow[i].checked){
			//检查表单选择
		   if(globalformIDRow[i].value=="*"){
			 alert("请选择 \""+nodeNameRow[i].value+"\" 环节表单。");
			 return;
		   }
		   count++;
	    }else{
		  globalformIDRow[i].value="*";
		}
	  }
	  WeekreportForm.submit();  

	}
  }

  //时间检查
  function checjkTime(timeString) {
	var nodeCodeRow = document.getElementsByName("nodeCodeRow");
	codeN=0;
	for(i=0;i<nodeCodeRow.length;i++){
	  if (nodeCodeRow[i].checked)
	    codeN=1;
	}
	if(codeN==0)
	  return true;
	if(timeString==""){
	  alert("请填写完整周报提醒时间。");
	  WeekreportForm.noteTime.focus();
	  return false;
	}

	var n=0;
	n=timeString.indexOf(":");
	if(n<=0){
	  alert("请填写正确的时间。");
	  WeekreportForm.noteTime.value="";
	  WeekreportForm.noteTime.focus();
	  return false;
	}else{
	  var leftStr=timeString.substring(0,n);
	  var leftInt=parseInt(leftStr);
	  var rightStr=timeString.substring(n+1);
	  var rightInt=parseInt(rightStr);
//	  if(leftInt.toString().length!=leftStr.length || rightInt.toString().length!=rightStr.length){
//        alert("请填写正确的时间。");
//	    WeekreportForm.noteTime.value="";
//	    WeekreportForm.noteTime.focus();
//		return false;
//	  }else{
		if(leftInt<0 || leftInt>24){
          alert("请填写正确的时间。");
	      WeekreportForm.noteTime.value="";
	      WeekreportForm.noteTime.focus();
		  return false;
		}
		if(rightInt<0 || rightInt>60){
          alert("请填写正确的时间。");
	      WeekreportForm.noteTime.value="";
	      WeekreportForm.noteTime.focus();
		  return false;
		}
	  //}
	}
	return true;
  }
